<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="/common/template :: header(~{::title},~{::link},~{::style})">
    <script>
        window.onload = function () {
            alert(warnData); // 这将弹出从后端传过来的warnData值
        };
    </script>
</head>
<body>
<div class="layui-form timo-compile">
    <form th:action="@{/manage/productPackage/save}">
        <!--        <input type="hidden" name="id" th:if="${productPackage}" th:value="${productPackage.id}">-->

        <input type="hidden" name="product_id" th:if="${Product}" th:value="${Product.id}">
        <label class="layui-form-label required">套餐名称</label>
        <div th:if="${warnData == null }" class="layui-input-inline">
            <select name="package_id" class="select" lay-filter="custId" lay-search="">
                <option value="">请选套餐</option>
                <span th:each="package:${packageList}">
                        <option th:if="${package.id}" th:text="${package.name} "
                                th:value="${package.id}"></option>

                    </span>
            </select>
        </div>
        <div th:if="${warnData != null }" class="layui-input-inline">
            <span>[[${warnData}]]</span>
        </div>

        <!--        <div class="layui-form-item">-->
        <!--            <label class="layui-form-label">产品ID</label>-->
        <!--            <div class="layui-input-inline">-->
        <!--                <input class="layui-input" type="text" name="product_id" placeholder="请输入产品ID" th:value="${productPackage?.product_id}">-->
        <!--            </div>-->
        <!--        </div>-->
        <!--        <div class="layui-form-item">-->
        <!--            <label class="layui-form-label">套餐ID</label>-->
        <!--            <div class="layui-input-inline">-->
        <!--                <input class="layui-input" type="text" name="package_id" placeholder="请输入套餐ID" th:value="${productPackage?.package_id}">-->
        <!--            </div>-->
        <!--        </div>-->
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <textarea placeholder="请输入内容" class="layui-textarea"
                          name="remark">[[${productPackage?.remark}]]</textarea>
            </div>
        </div>
        <div class="layui-form-item timo-finally">
            <button class="layui-btn ajax-submit"><i class="fa fa-check-circle"></i> 保存</button>
            <button class="layui-btn btn-secondary close-popup"><i class="fa fa-times-circle"></i> 关闭</button>
        </div>
    </form>
</div>
<script th:replace="/common/template :: script"></script>
</body>
</html>